package com.asia.algorithmcode.array;

/**
 * 136、只出现一次的数字
 */
public class SingleNumber {


    public static void main(String[] args) {
        int[] arr = {2,2,1};
        System.out.println(new SingleNumber().singleNumber(arr));
    }

    public int singleNumber(int[] nums) {
        int result = 0;
        for (int num : nums) {
            result ^= num;
        }
        return result;
    }
}
